package indi.zn.commons.simplepoi;



import java.util.ArrayList;
import java.util.List;

import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;

public class SSFUtilColumn {
	
	
	private Integer[] ypiont;
	
	private List<HSSFCell> cells;
	
	
	public HSSFCell getCell(int index){
		
		return this.cells.get(index);
	}
	
	public Integer[] getYpiont(){
		return ypiont;
		
	}
	
	public List<HSSFCell> getCellList(){
		return cells;
		
	}
	
	
	
	
	public SSFUtilColumn(HSSFSheet sheet,Integer[] ypiont) {
	
		this.ypiont=ypiont;
		cells=new ArrayList<HSSFCell>();
		laodCells(sheet);
		
	}
	
	
	private void laodCells(HSSFSheet sheet){
		
		for (int i = 0; i < sheet.getLastRowNum(); i++) {
			
		HSSFRow row=	sheet.getRow(i);
		if(row==null){
			cells.add(null);
		}else{
		for(Integer integer : ypiont){
			HSSFCell cell=	row.getCell(integer);
			cells.add(cell);
		}
			
		}
		}
		
		
		
	}
	

}
